<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class dashboard extends CI_Controller {
	var $data;
	public function __construct()
	{
		parent::__construct();		
		$this->load->library('session');
		$this->load->model('model_user');
		$data['title'] = "Dashboard";
		$check = $this->session->userdata('login');
		if($check==false){
			 redirect(base_url().'login/', 'refresh');
			 return;
		}
	}
	
	public function index()
	{
		//print_r($this->session->all_userdata());

	$user_info =  $this->session->userdata('user_info');
	$my_permisstion = $user_info["permission_apps"]["AM_SALE_SUPPORT"];		
	 if(isset($my_permisstion["timeline"]["index"])){	
		redirect(base_url().'timeline/', 'refresh');
	 }else{
		redirect(base_url().'companies/', 'refresh');
	 }
			$this->view();
	}

	public function view(){
		$this->data["set_page"]='dashboard_view';
		$this->load->view('qt/dashboard', $this->data);
	}

	public function wall(){
		$this->data["set_page"]='wall_list';
		$this->load->view('qt/dashboard', $this->data);
	}

}

